package com.code.config;

import com.code.generator.provider.MetadataProvider;
import com.code.generator.provider.SimpleMetadataProvider;

public enum DataSourceInfo {
    /**
     * 连接地址
     */
    URL("jdbc:dm://xxxxx:5236/SYSDBA?clobAsString=1&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false"),
    /**
     * 账号
     */
    USERNAME("SYSDBA"),
    /**
     * 密码
     */
    PASSWORD("SYSDBA"),
    /**
     * 库名
     */
    TABLE_SCHEMA("SYSDBA"),
    /**
     * 驱动
     */
    DRIVER_CLASS(DataSourceSql.dm.getType()),

    ;

    private String value;

    public static String getDriver() {
        return DataSourceSql.getDriver(DataSourceInfo.DRIVER_CLASS.value);
    }

    public static MetadataProvider getMetadataProvider() {
        return new SimpleMetadataProvider();
    }


    public static String getTableSql() {
        return DataSourceSql.getTableSql(DRIVER_CLASS.getValue());
    }

    public static String getColumnSqlSql() {
        return DataSourceSql.getColumnSqlSql(DRIVER_CLASS.getValue());
    }

    DataSourceInfo(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
